package designPattern.AdapterPattern1;

/**
 * @author jiangwz
 * @create 2019/11/12.
 */
public class Main {

    public static void main(String[] args){

        SDCard xiaomi = new SDCardImpl();
        Computer thinkpad = new ThinkPadComputer();
        System.out.println(thinkpad.readSD(xiaomi));

        // 新增TF卡
//        thinkpad.readSD(new TFCardImpl());// 不适配
        // 增加适配类
        TFCardImpl tfCard = new TFCardImpl();
        SDAdapterTF sdAdapterTF = new SDAdapterTF(tfCard);
        System.out.println(thinkpad.readSD(sdAdapterTF));
    }
}
